<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

// Route::rule('路由表达式','路由地址','请求类型','路由参数（数组）','变量规则（数组）');
//GET,POST,DELETE,PUT,*
//三段式：模块，控制器，操作方法名
// Route::get('hello','sample/Test/hello');

//轮播图
Route::get('api/:version/banner/:id','api/:version.Banner/getBanner');

//专栏位
Route::get('api/:version/theme','api/:version.Theme/getSimpleList');
Route::get('api/:version/theme/:id','api/:version.Theme/getComplexOne');

//商品
Route::get('api/:version/product/by_category','api/:version.Product/getAllInCategory');
Route::get('api/:version/product/:id','api/:version.Product/getOne',[],['id'=>'\d+']);
Route::get('api/:version/product/recent','api/:version.Product/getRecent');

//路由的另一种写法
// Route::group('api/:version/product',function(){
//     Route::get('/by_category','api/:version.product/getAllInCategory');
//     Route::get('/:id','api/:version.product/getOne',[],['id'=>'\d+']);
//     Route::get('/recent','api/:version.product/getRecent');
// });

//类别
Route::get('api/:version/category/all','api/:version.Category/getAllCategories');

//令牌
Route::post('api/:version/token/user','api/:version.Token/getToken');
Route::post('api/:version/token/verify','api/:version.Token/verifyToken');
Route::post('api/:version/token/app','api/:version.Token/getAppToken');

//地址
Route::post('api/:version/address','api/:version.Address/createOrUpdateAddress');
Route::get('api/:version/address','api/:version.Address/getUserAddress');

//订单
Route::post('api/:version/order','api/:version.Order/placeOrder');
Route::post('api/:version/by_user','api/:version.Order/getSummarByUser');

//支付接口
Route::post('api/:version/pay/pre_order','api/:version.Pay/getPreOrder');
Route::post('api/:version/pay/notify','api/:version.Pay/receiveNotify');

//前置方法测试
// Route::get('api/:version/second','api/:version.Address/second');

